#!/bin/bash

COMMANDPATH=${COMMANDPATH:-./tntesi}

if [ ${#*} -lt 4 ]; then
 echo "usage:"
 echo "  execute.sh METHOD N_RUNS N_ITERS FILE [TYPE]"
 echo
 exit 1
fi

METHOD=$1
#LETTERS='a b c d e f g h i j '

if [ ${#*} -eq 5 ];then
 TYPE="$5"
else
 TYPE=b
fi

#QUESTE=${LETTERS:0:$((2*$2))}
N_ITERS=$3
INFILE=$4

for((RUN=0;RUN<$2;RUN++)); do $COMMANDPATH -u1 -m$METHOD -i$N_ITERS -v1010 -$TYPE $INFILE >`basename ${INFILE%%.*}`_m${METHOD}_`hostname`-`printf '%02d' $RUN`; done 
